import { Component, OnInit } from '@angular/core';
import { OAuthService } from 'angular-oauth2-oidc';
import {MyOAuthService} from "./core/my-oauth-service";

@Component({
  selector: 'oidc-app-should-login',
  template: `
    <p class="alert alert-dark">You need to be logged in to view requested page.</p>
    <p>Please <a href="#" (click)="login($event)">zmhhxl login</a> before continuing.</p>
  `,

})
export class ShouldLoginComponent implements OnInit {

  constructor(private authService: MyOAuthService) { }

  ngOnInit(): void {
  }

  public login(event: Event) {
    event.preventDefault();
    this.authService.initLoginFlow();
  }

}
